<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height">
    <div class="border-hover-style" style="display: flex">  
      <div 
        class="content-parent"  
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style7/Level3outlinestyle1Bg.webp'})`,
        }"
      >
        <div class="digitalShowroom-p" v-if="props.info.digitalShowroom">
          <digitalShowroomIcon :url="props.info.digitalShowroom" />
        </div>
        <div class="content">
          <div class="title-box">
            <div class="title-content">{{ props.info.text }}</div>
          </div>
          <p class="subtitle" v-if="props.info.subTitle">——{{ props.info.subTitle }}</p>
          <div
            class="img-box"
            :class="{
              'img-box1': props.info.remarks && props.info.subTitle,
              'img-box2': props.info.remarks && !props.info.subTitle,
              'img-box3': !props.info.remarks && props.info.subTitle,
              'img-box4': !props.info.remarks && !props.info.subTitle,
            }"
            v-if="props.info.value"
          >
            <div class="outline-cover">
              <img @click="ImgVisible = true" :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" />
            </div>
          </div>
          <div class="remarks1" v-if="props.info.value">
            <TextMax
              :color2="false"
              :infoData="props.info"
              v-if="props.domShow"
              :data="props.info.remarks"
              :title="props.info.text"
              :row="6" 
            ></TextMax>  
          </div>  
          <div class="remarks2"
          :class="{'remarks3':!props.info.subTitle}"
           v-else-if="props.info.remarks">
            <TextMax
              :color2="false"  
              :infoData="props.info" 
              v-if="props.domShow"
              :data="props.info.remarks"
              :title="props.info.text"
              :row="props.info.subTitle?14:16"
            ></TextMax>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>  

<script lang="ts">
export default defineComponent({
  name: 'free5Style4',
});
</script>

<script setup lang="ts">
import { getRemarksNum } from '@/utils/minxin';
import digitalShowroomIcon from '@/freeComponents/unitdigitalShowroom/style7.vue';
import { publicUrls } from '@/utils/minxin';
import { getTextHtml, textType } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { computed, defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/textMax7.vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';
const route = useRoute();
const ImgVisible = ref(false);
const store = useProjectStore();
const title = ref();

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});
</script>

<style scoped lang="less">
.outline-parent {
  display: flex;
  align-items: flex-end;
  position: relative;
  margin-right: 140px;
  margin-left: 40px;
  margin-top: 0;
  height: 100%;
}
.content-parent {
  display: flex; 
  position: relative;   
  width: 520px;   
  height: 684px;  
  background-size: 100% 100%; 
  background-repeat: no-repeat;
}
.digitalShowroom-p {  
  position: absolute;
  top: 10px; 
  right: 36px; 
  width: 32px;
  height: 44px;
  z-index: 15;
}
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 520px;
  height: 684px;
  margin: 49px 70px;
  z-index: 6;
  position: relative;
}

.title-box {
  display: flex; 
  align-items: center;
  justify-content: center;
  width: 368px;
  height: 46px;
  border: 0.6px solid rgba(112, 157, 134, 1);
}
.title-content {
  display: flex; 
  align-items: center;
  justify-content: center;
   width: 360px;
  height: 38px;
  background: rgba(251, 242, 226, 1);
  border: 0.6px solid rgba(112, 157, 134, 1);
  font-family: SourceBold; 
  font-size: 20px; 
  color: rgba(112, 157, 134, 1); 
  line-height: 30px;
  text-align: center;
}
.subtitle {
  margin-top: 16px;
  width: 380px; 
  font-family: SourceMedium;
  font-size: 16px;
  color: rgba(51, 51, 51, 1);
  line-height: 28px;
  text-align: center;
}
.img-box {
  position: relative;  
  overflow: hidden;
  background: rgba(232, 225, 212, 1);
  margin-top: 16px;
  width: 380px;
  height: 220px;
  .outline-cover {
    width: 100%;
    height: 100%;
    object-fit: contain;
    overflow: hidden;
    img {
      transition: all 0.3s;
      width: 100%;
      height: 100%;
      object-fit: contain;
    }
  }
}
.img-box:hover {
  .outline-cover {
    img {
      transform: scale(1.2);
    }
  }
}
.img-box1 {
  display: flex;
}
.img-box2 {
  
}

.img-box3{
 width: 380px;
  height: 420px;
  margin-top: 24px;
}
.img-box4 {  
  width: 380px;
  height: 524px;
  margin-top: 24px;
}

.remarks1 { 
  width: 380px;
  margin-top: 16px;
  :deep(.van-text-ellipsis) {
  }
}
.remarks2 {
  width:380px;
  margin-top: 16px;
}
.remarks3{
  width: 380px;
  margin-top: 24px;
}
</style>